package com.tanhua.model.vo;

import com.tanhua.model.db.Questions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class QuestionsVo implements Serializable {

    private String id;//题目编号

    private Long testsoulId;//问卷id

    private String question;//问卷题目

    private List<OptionsVo> options;//问卷选项

    public static QuestionsVo init(Questions questions){
        QuestionsVo questionsVo = new QuestionsVo();
        questionsVo.setId(questions.getId().toString());
        questionsVo.setTestsoulId(questions.getTestsoulId());
        questionsVo.setQuestion(questions.getQuestion());
        questionsVo.setOptions(questions.getOptions());
        return questionsVo;
    }
}
